import { createRouter, createWebHistory } from 'vue-router'
import errorRoute from '@/views/errorpage/route'
import loginRoute from '@/views/logins/route'
import mainRoute from '@/views/mains/route'

const routes = [
 ...errorRoute,
 ...loginRoute,
 ...mainRoute,
 {
   path:'/:pathMatch(.*)',
   redirect:{
     name:'404'
   }
 },
 {
    path:'/',
    redirect:{
      name:'home'
    }
  },
 
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
